package com.alib.springclou.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;


@RestController

public class PaymentConsulController {

    // 使用自定义的 RestTemplate
    @Autowired
    RestTemplate restTemplate;

    public static final String PAYMENT_URL = "http://cloud-provider-payment8001-consul";

    @GetMapping("/consumer/payment/consul")
    public String getPayment() {
        return restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);
    }

}
